﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NetDon.Utilities;

namespace NetDon.OA.Interface.Location
{
    [Serializable]
    public class ProvinceData
    {
       
        public string ProvinceId { get; set; }
        public string Name { get; set; }
        
        IEnumerable<CityData> GetCities()
        {
            var service = ServiceContainer.GetService<ILocationService>();
            return service.GetCities(ProvinceId);
        }
    }

    [Serializable]
    public class CityData
    {
       
        public string CityId { get; set; }
        public string Name { get; set; }
        public string ProvinceId { get; set; }
        IEnumerable<AreaData> GetAreas()
        {
            var service = ServiceContainer.GetService<ILocationService>();
            return service.GetAreas(CityId);
        }
    }

    [Serializable]
    public class AreaData
    {
        public string AreaId { get; set; }
        public string Name { get; set; }
        public string CityId { get; set; }
    }
}
